
import $validate from '@/utils/open/validate'

export const testFunc = {
  init(listStore, dataList) {
    debugger
    for (const listItem of dataList) {
      listItem.value = 0
      debugger
      for (const key in listStore) {
        debugger
        if (listItem.keyid === key) {
          const groups = listStore[key] || []
          listItem.total = groups.length
          // console.log(key, groups)
          debugger
          groups.some(forms => {
            const formData = forms.data || []
            debugger
            formData.some(formItem => {
              const list = formItem.list || []
              debugger
              return list.some(obj => {
                const val = obj.value
                if (!$validate.isNull(val)) {
                  debugger
                  listItem.value++
                  return true
                }
              })
            })
          })
          debugger
          break
        }
      }
    }
  }
}
